package com.xigua.chapter_6_prototype.framework;

import com.xigua.chapter_6_prototype.framework.Product;

/**
 * @author LiRongHua
 * @Title: ${file_name}
 * @Package ${package_name}
 * @Description: ${todo}
 * @date 2022/4/815:39
 */
public class MessageBox implements Product {

    private char decohcar;

    public MessageBox(char decohcar) {
        this.decohcar = decohcar;
    }

    public void use(String s) {
        int length = s.length()+4;
        for (int i = 0; i < length; i++) {
            System.out.print(decohcar);
        }
        System.out.println("");
        System.out.println(decohcar+" "+s+" "+decohcar);
        for (int i = 0; i < length; i++) {
            System.out.print(decohcar);
        }
        System.out.println("");
    }

    public Product createClone() {
        Product p = null;
        try {
            p = (Product) clone();
        } catch (CloneNotSupportedException e) {
            e.printStackTrace();
        }
        return p;
    }
}
